<?php 	
 	@chmod($UPLOAD_DIR, 0777);
	@chmod($UPLOAD_DIR.'/'.$usuario, 0777);
	
	// al momento de ingresar a la web elimina todos los archivos del temporal
 	//formatearDir($UPLOAD_DIR.$usuario.'/'.$tip.'/');	
			
 ?>
<link rel="stylesheet" href="<?php echo URL_PATH;?>css/cargas/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo URL_PATH;?>css/cargas/jquery.fileupload-ui.css">
<link rel="stylesheet" href="<?php echo URL_PATH;?>css/splitter.css" title="dark" type="text/css" media="screen" />
<script type="text/javascript"> 
$().ready(function() {

  $("#Archivos_Adjuntos").css("display", "none");	

  $('#btn_reg_carta').click(function() {  
        $(".box-form").fadeIn();
		$("#btn_reg_carta").css("display", "none");		
		$("#btn_ocu_carta").css("display", "");			
		$("#listado").hide();
		$('#id').val('');	
		$('#nroCarta').val('');	
		
		$("#chk1").attr("checked",false);	
		$("#chk2").attr("checked",false);	
		$("#chk3").attr("checked",false);					
		
		$('#estCarta').val(0);	
		$('#respuesta').val(0);					
		$('#tc').val(0);
		$('#observaciones').val('');	
		$('#fecCarta').val('');	
		$('#fecRecepcion').val('');	
		$('#fecCarta21').val('');	
		$('#fecRecepcion21').val('');	
		$('#fecCarta22').val('');	
		$('#fecRecepcion22').val('');	

		$('#relacionadas').val('');	
		$('#nroCarta').removeAttr('disabled');
		
		$('#contrato').removeAttr('disabled');
		
		$("#Archivos_Adjuntos").css("display", "none");		
		$("#estado_respuesta").css("display", "none");					
    });  
	
  $('#btn_ocu_carta').click(function() {  
		$("#Archivos_Adjuntos").css("display", "none");									  
        $(".box-form").fadeOut();  
		$("#btn_reg_carta").css("display", "");				
		$("#btn_ocu_carta").css("display", "none");	
		$('#id').val('');	
		$('#nroCarta').val('');	
		$("#listado").show();
		$('#contrato').val(0);	
		
		$('#estCarta').val(0);	
		$('#respuesta').val(0);					
		$('#tc').val(0);
		$('#observaciones').val('');	
		$('#fecCarta').val('');	
		$('#fecRecepcion').val('');	
		$('#relacionadas').val('');		
    });  


	 
});
 
 				
</script>
     <title></title>
<form id="fileupload" action="<?php echo URL_PATH;?>vista/upload/vista/cargas/server/" method="post" enctype="multipart/form-data">
<input type="hidden" id="tipo_mm" name="tipo_mm" value="<?php echo $tip;?>" >
  <tr><td><tr><td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td></td>
  </tr>
                         
                            <tr>
                              <td height="4" colspan="5"></td>
                            </tr>
                            <tr>
                              <td height="1" colspan="5" ></td>
                            </tr>
                            <tr><td height="10" colspan="5">
  <tr>
    <td height="2"  align="right" ></td>
  </tr>
  <tr>
    <td><div id="Archivos_Adjuntos" style="display:none;"></div>
      <div class="letra_detalle"></div>
      
            <div class="row fileupload-buttonbar">
              <div class="span7">
                <span class="btn btn-success fileinput-button"> <i class="icon-plus icon-white"></i> <span>Adjuntar </span>
                <input type="file" name="files[]" multiple="multiple" />
                </span>
                <button type="submit" class="btn btn-primary start"> <i class="icon-upload icon-white"></i> <span>Iniciar</span></button>
                <input type="button" value="Cerrar" id="Cerrar" onclick="actualizarMM()" >
                <button type="reset" style="display:none;" class="btn btn-warning cancel"> <i class="icon-ban-circle icon-white"></i> <span>Cancelar</span> </button>
                <button style="display:none;" type="button" class="btn btn-danger delete"> <i class="icon-trash icon-white"></i> <span>Borrar</span> </button>
                <input name="checkbox" style="display:none;" type="checkbox" class="toggle" />
              </div>
            </div>

            <div class="fileupload-loadingd"></div>
            <table role="presentation" id="presentacion" class="table table-striped">
              <tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery">
              </tbody>
            </table>
</form>
      <script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td class="preview"><span class="fade"></span></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% if (file.error) { %}
            <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
        {% } else if (o.files.valid && !i) { %}
            <td>
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
            </td>
            <td class="start">{% if (!o.options.autoUpload) { %}
                <button class="btn btn-primary">
                    <i class="icon-upload icon-white"></i>
                    <span>Start</span>
                </button>
            {% } %}</td>
        {% } else { %}
            <td colspan="2"></td>
        {% } %}
        <td class="cancel">{% if (!i) { %}
            <button class="btn btn-warning">
                <i class="icon-ban-circle icon-white"></i>
                <span>Cancel</span>
            </button>
        {% } %}</td>
    </tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        {% if (file.error) { %}
            <td></td>
            <td class="name"><span>{%=file.name%}</span></td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
            <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
        {% } else { %}
            <td class="preview">{% if (file.thumbnail_url) { %}
                <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
            {% } %}</td>
            <td class="name">
                <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
            </td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
            <td colspan="2"></td>
        {% } %}
        <td class="delete">
            <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
                <i class="icon-trash icon-white"></i>
                <span>Borrar</span>
            </button>
        </td>
    </tr>
{% } %}	
</script>
<script src="<?php echo URL_PATH;?>js/cargas/jquery.ui.widget.js"></script>
<script src="<?php echo URL_PATH;?>js/cargas/tmpl.min.js"></script>
<script src="<?php echo URL_PATH;?>js/cargas/jquery.fileupload.js"></script>
<script src="<?php echo URL_PATH;?>js/cargas/jquery.fileupload-fp.js"></script>
<script src="<?php echo URL_PATH;?>js/cargas/jquery.fileupload-ui.js"></script>
<script src="<?php echo URL_PATH;?>js/cargas/main.js"></script>	</td>
  </tr></td>				